<?php

use yii\db\Migration;

/**
 * Class m180725_022709_bind_phone_table
 */
class m180725_022709_notice_api_log_table extends Migration
{
    // Use up()/down() to run migration code without a transaction.
    public function up()
    {
        $tableOptions = null;
        if ($this->db->driverName === 'mysql') {
            $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB';
        }
        $this->createTable("{{%notice_api_log}}", [
            'id' => $this->primaryKey(),
            'phone' => $this->string(11),
            'coupon_id' => $this->integer(10),
            'created_at' => $this->integer(11),
            'updated_at' => $this->integer(11),
            'attempt' => $this->integer(5),
            'msg' => $this->string(),
            'status' => $this->smallInteger(2)
        ], $tableOptions);
        return true;
    }

    public function down(){
        $this->dropTable("{{%notice_api_log}}");
        return true;
    }
}
